//
// NeL - bindings
// Copyright (C) 2010 Naush
//
//This program is free software: you can redistribute it and/or modify
//it under the terms of the GNU Affero General Public License as
//published by the Free Software Foundation, either version 3 of the
//License, or (at your option) any later version.
//
//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU Affero General Public License for more details.
//
//You should have received a copy of the GNU Affero General Public License
//along with this program.  If not, see <http://www.gnu.org/licenses/>.
package org.ryzom.nel.misc;

public class CRGBAF {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public CRGBAF(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(CRGBAF obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nelmiscJNI.delete_CRGBAF(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public CRGBAF() {
    this(nelmiscJNI.new_CRGBAF__SWIG_0(), true);
  }

  public CRGBAF(float _r, float _g, float _b, float _a) {
    this(nelmiscJNI.new_CRGBAF__SWIG_1(_r, _g, _b, _a), true);
  }

  public CRGBAF(float _r, float _g, float _b) {
    this(nelmiscJNI.new_CRGBAF__SWIG_2(_r, _g, _b), true);
  }

  public CRGBAF(CRGBA c) {
    this(nelmiscJNI.new_CRGBAF__SWIG_3(CRGBA.getCPtr(c), c), true);
  }

  public void normalize() {
    nelmiscJNI.CRGBAF_normalize(swigCPtr, this);
  }

  public CRGBAF add(CRGBAF c) {
    return new CRGBAF(nelmiscJNI.CRGBAF_add(swigCPtr, this, CRGBAF.getCPtr(c), c), true);
  }

  public CRGBAF sub(CRGBAF c) {
    return new CRGBAF(nelmiscJNI.CRGBAF_sub(swigCPtr, this, CRGBAF.getCPtr(c), c), true);
  }

  public CRGBAF mul(CRGBAF c) {
    return new CRGBAF(nelmiscJNI.CRGBAF_mul__SWIG_0(swigCPtr, this, CRGBAF.getCPtr(c), c), true);
  }

  public CRGBAF mul(float f) {
    return new CRGBAF(nelmiscJNI.CRGBAF_mul__SWIG_1(swigCPtr, this, f), true);
  }

  public CRGBAF div(float f) {
    return new CRGBAF(nelmiscJNI.CRGBAF_div(swigCPtr, this, f), true);
  }

  public CRGBAF addSelf(CRGBAF c) {
    return new CRGBAF(nelmiscJNI.CRGBAF_addSelf(swigCPtr, this, CRGBAF.getCPtr(c), c), false);
  }

  public CRGBAF subSelf(CRGBAF c) {
    return new CRGBAF(nelmiscJNI.CRGBAF_subSelf(swigCPtr, this, CRGBAF.getCPtr(c), c), false);
  }

  public CRGBAF mulSelf(CRGBAF c) {
    return new CRGBAF(nelmiscJNI.CRGBAF_mulSelf__SWIG_0(swigCPtr, this, CRGBAF.getCPtr(c), c), false);
  }

  public CRGBAF mulSelf(float f) {
    return new CRGBAF(nelmiscJNI.CRGBAF_mulSelf__SWIG_1(swigCPtr, this, f), false);
  }

  public CRGBAF divSelf(float f) {
    return new CRGBAF(nelmiscJNI.CRGBAF_divSelf(swigCPtr, this, f), false);
  }

  public void serial(IStream f) {
    nelmiscJNI.CRGBAF_serial(swigCPtr, this, IStream.getCPtr(f), f);
  }

  public void set(float r, float g, float b, float a) {
    nelmiscJNI.CRGBAF_set(swigCPtr, this, r, g, b, a);
  }

  public void setR(float value) {
    nelmiscJNI.CRGBAF_R_set(swigCPtr, this, value);
  }

  public float getR() {
    return nelmiscJNI.CRGBAF_R_get(swigCPtr, this);
  }

  public void setG(float value) {
    nelmiscJNI.CRGBAF_G_set(swigCPtr, this, value);
  }

  public float getG() {
    return nelmiscJNI.CRGBAF_G_get(swigCPtr, this);
  }

  public void setB(float value) {
    nelmiscJNI.CRGBAF_B_set(swigCPtr, this, value);
  }

  public float getB() {
    return nelmiscJNI.CRGBAF_B_get(swigCPtr, this);
  }

  public void setA(float value) {
    nelmiscJNI.CRGBAF_A_set(swigCPtr, this, value);
  }

  public float getA() {
    return nelmiscJNI.CRGBAF_A_get(swigCPtr, this);
  }

}
